home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / misc-part2 / 11680 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Date: 9 Apr 1996 16:55:32 GMT-0400
  2. Path: shoestring.opus-networx.com!dnn
  3. Newsgroups: comp.sys.amiga.misc
  4. From: dnn@shoestring.opus-networx.com (Amigaboy)
  5. Message-ID: <8290833353303@shoestring.opus-networx.com>
  6. Organization: OPUS NETWORX BBS - 809-628-5023
  7. References: <401.6670T240T431@nibelung.demon.co.uk>
  8. Subject: RE: Amigados - checking f
  9.  
  10.  
  11.  > What would be the format to check the existence of a file in a script for
  12.  > dos?  I would have thought something like this:
  13.  > 
  14.  > If EXISTS blah:filename
  15.  >   dowhatever
  16.  >   else
  17.  >    dothatinstead
  18.  >    endif
  19.  > endif
  20.  > 
  21.  > but this doesn't work.
  22.  > 
  23.  >         Barry Shilliday  --  <barry@nibelung.demon.co.uk>
  24.  >           
  25.  
  26.   Barry, try using 'FailAt 21' before the IF EXISTS so-so-so.  If blah:filename
  27.   was not found a non-zero return code (20) for the command would be returned
  28.   causing your script to fail.  So by setting your fail limit to more than 20
  29.   your script would continue even if blah:filename was not found.
  30.   
  31.   So your script should look something like this:
  32.   
  33.   FailAt 21
  34.   IF EXISTS blah:filename
  35.      dowhatever
  36.   ELSE
  37.      dothatinstead
  38.   ENDIF
  39.   
  40.                     +----------------------------------+
  41.                     |        Dwight N. Nelson          |
  42.                     |    amigaboy@opus-networx.com     |
  43.                     +----------------------------------+
  44.